﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using QstkCore;
using QstkCore.Util;

namespace Tests
{
    [TestClass]
    public class TimeSeriesTests
    {
        [TestMethod]
        public void ReturnizeBasicTest()
        {
            IList<float> prices = new List<float> { 5, 5.5f, 6.05f, 6.655f, 7.3205f };
            var newPrices = prices.Returnize();
            Assert.IsTrue(newPrices.Skip(1).All(o => Math.Abs(o - 0.1d) < 0.0001));
        }
    }
}
